jQuery.extend({ 
	/**
	 *@summary:
	 *  	将JSON对象转换为JSON字符串
	 * @param: 
	 * 		{json object} object 
	 * 		JSON对象
	 * @return :
	 * 		{string} 返回字符串
	 */
   toJSONString: function(object) {
	 if (object === null) return 'null';
     var type = typeof object; 
     if ('object' == type) { 
       if (Array == object.constructor) type = 'array'; 
       else if (RegExp == object.constructor) type = 'regexp'; 
       else type = 'object';
       		} 
     switch (type) { 
     case 'undefined': 
     case 'unknown': 
       return; 
       break; 
     case 'function': 
     case 'boolean': 
     case 'regexp': 
       return object.toString(); 
       break; 
     case 'number': 
       return isFinite(object) ? object.toString() : 'null'; 
       break; 
     case 'string': 
       return '"' + object.replace(/(\\|\")/g, "\\$1").replace(/\n|\r|\t/g, function() { 
         var a = arguments[0]; 
         return (a == '\n') ? '\\n': (a == '\r') ? '\\r': (a == '\t') ? '\\t': "" 
       }) + '"'; 
       break; 
     case 'object': 
       if (object === null) return 'null'; 
       var results = []; 
       for (var property in object) { 
         var value = jQuery.toJSONString(object[property]); 
         if (value !== undefined) results.push(jQuery.toJSONString(property) + ':' + value); 
       } 
       return '{' + results.join(',') + '}'; 
       break; 
     case 'array': 
       var results = []; 
       for (var i = 0; i < object.length; i++) { 
         var value = jQuery.toJSONString(object[i]); 
         if (value !== undefined) results.push(value); 
       } 
       return '[' + results.join(',') + ']'; 
       break; 
     } 
   } ,
   
   /**
	 *@summary:
	 *  	判断是否为空
	 * @param: 
	 * 		{json object} str 
	 * 		字符串
	 * @return :
	 * 		{bool} 返回bool值
	 * @example:
	 * |<script>
	 * | alert($.isEmpty(''));
	 * |</script>
	 */
   isEmpty : function(data){
	   if(!data || data.length==0) return true;
	   if(data instanceof Array){
			return data.length==0;
		}
		if(typeof(data) =="object"){
			for(var _t in data){
				return false;
			}
			return true;
		}
	   return false;
   },
   
   /**
	 *@summary:
	 *  	深拷贝json对象
	 * @param: 
	 * 		{json object} obj 
	 * 		复制的源对象
	 * @return :
	 * 		{date} 深拷贝后的对象
	 * @example:
	 * |<script>
	 * | var obj = {key : 'aaa'};
	 * | alert($.deepCopy(obj));
	 * |</script>
	 */
   deepCopy : function(obj) {
	   var clone = {};
	   if(obj==null) return obj;
	   if(obj.constructor==Array)clone = [];
       for(var i in obj) {
           if(typeof(obj[i])=="object")
               clone[i] = $.deepCopy(obj[i]);
           else
               clone[i] = obj[i];
       }
       return clone;
   }
   
});